<?php

namespace App\Http\Controllers\admin;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class AdminController extends Controller
{
    // 后台登录后的主页面
    public function getIndex(){
    	if(empty(session('id'))){
    		return redirect('/admin')->with('error','请您登陆');
    	}
        return view('admin/admin/index');
    }
      // 退出 清除session
     public function getOut(Request $request){
        $request -> session() -> forget('id','username');
        return redirect('admin')->with('error','退出成功');
     }

}
